<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="bayiGps" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{bayiGpsHome.managed ? 'Edit' : 'Add'} Bayi gps</f:facet>


            <s:decorate id="idField" template="layout/edit.xhtml">
                <ui:define name="label">Id</ui:define>
                <h:inputText id="id"
                       required="true"
                          value="#{bayiGpsHome.instance.id}"
                           size="26">
                    <a:support event="onblur" reRender="idField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>



            <s:decorate id="latitudeField" template="layout/edit.xhtml">
                <ui:define name="label">Latitude</ui:define>
                <h:inputText id="latitude"
                       required="true"
                           size="20"
                      maxlength="20"
                          value="#{bayiGpsHome.instance.latitude}">
                    <a:support event="onblur" reRender="latitudeField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="longitudeField" template="layout/edit.xhtml">
                <ui:define name="label">Longitude</ui:define>
                <h:inputText id="longitude"
                       required="true"
                           size="20"
                      maxlength="20"
                          value="#{bayiGpsHome.instance.longitude}">
                    <a:support event="onblur" reRender="longitudeField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="typeField" template="layout/edit.xhtml">
                <ui:define name="label">Type</ui:define>
                <h:inputText id="type"
                           size="1"
                      maxlength="1"
                          value="#{bayiGpsHome.instance.type}">
                    <a:support event="onblur" reRender="typeField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>

            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{bayiGpsHome.persist}"
                       disabled="#{!bayiGpsHome.wired}"
                       rendered="#{!bayiGpsHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{bayiGpsHome.update}"
                       rendered="#{bayiGpsHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{bayiGpsHome.remove}"
                      immediate="true"
                       rendered="#{bayiGpsHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/BayiGps.xhtml"
                rendered="#{bayiGpsHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty bayiGpsFrom ? 'BayiGpsList' : bayiGpsFrom}.xhtml"
                rendered="#{!bayiGpsHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Bayi">
    <div class="association" id="bayiParent">

        <h:outputText value="There is no bayi associated with this bayiGps."
                   rendered="#{bayiGpsHome.instance.bayi == null}"/>

        <rich:dataTable var="_bayi"
                   value="#{bayiGpsHome.instance.bayi}"
                rendered="#{bayiGpsHome.instance.bayi != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="bayiTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_bayi.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Ilce id</f:facet>
                <h:outputText value="#{_bayi.ilce.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Semtler id</f:facet>
                <h:outputText value="#{_bayi.semtler.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Iller id</f:facet>
                <h:outputText value="#{_bayi.iller.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Unvan</f:facet>
                <h:outputText value="#{_bayi.unvan}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Bayi kodu</f:facet>
                <h:outputText value="#{_bayi.bayiKodu}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Musterideki kodu</f:facet>
                <h:outputText value="#{_bayi.musteridekiKodu}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Bina adi</f:facet>
                <h:outputText value="#{_bayi.binaAdi}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Bina no</f:facet>
                <h:outputText value="#{_bayi.binaNo}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Cadde</f:facet>
                <h:outputText value="#{_bayi.cadde}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Daire no</f:facet>
                <h:outputText value="#{_bayi.daireNo}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Iptal</f:facet>
                <h:outputText value="#{_bayi.iptal}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Kat no</f:facet>
                <h:outputText value="#{_bayi.katNo}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Posta kodu</f:facet>
                <h:outputText value="#{_bayi.postaKodu}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Sokak</f:facet>
                <h:outputText value="#{_bayi.sokak}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ticari unvan</f:facet>
                <h:outputText value="#{_bayi.ticariUnvan}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ilce eski adi</f:facet>
                <h:outputText value="#{_bayi.ilceEskiAdi}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Semt adi eski</f:facet>
                <h:outputText value="#{_bayi.semtAdiEski}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Adres eski</f:facet>
                <h:outputText value="#{_bayi.adresEski}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Bayi tipi eski</f:facet>
                <h:outputText value="#{_bayi.bayiTipiEski}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Kullanici kodu eski</f:facet>
                <h:outputText value="#{_bayi.kullaniciKoduEski}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{bayiGpsHome.instance.bayi != null ? 'changeParent' : 'selectParent'}" value="#{bayiGpsHome.instance.bayi != null ? 'Change' : 'Select'} bayi"
                       view="/BayiList.xhtml">
                <f:param name="from" value="BayiGpsEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
